package com.group2.bankonline.mapper;

import com.group2.bankonline.pojo.Feedback;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author syf
 * @since 2024-07-15
 */
public interface FeedbackMapper extends BaseMapper<Feedback> {
    @Select("""
            select * from feedback where status = #{status};
            """)
    public List<Feedback> selectByStatus(@Param("status") int status);

    @Select("""
            select * from feedback where personid = #{personid} and status = #{status};
            """)
    public List<Feedback> selectByStatusAndPersonId(@Param("personid")int personId,@Param("status")int status);
    @Update("""
            update feedback set feedback = #{feedback},status = #{status} where id = #{id};
            """)
    public int updateFeedback(@Param("feedback")String feedback,@Param("status")int status,@Param("id")int id);
}
